package org.yixiu.producer.invoke;

import java.util.HashMap;
import java.util.Map;

/**
 * 保存了producer端接⼝名和接⼝实现类的映射关系
 * 以便根据请求对象的接⼝名，找到对应的实现类
 */
public class ServiceMap {

    private static Map<String,Object> serviceMap = new HashMap<>();

    public static void registerService(String serviceKey,Object service){
        serviceMap.put(serviceKey,service);
    }

    public static Object lookupService(String serviceKey){
        return serviceMap.get(serviceKey);
    }
}
